-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[system] Fix maxWidth incorrectly resolving breakpoints with non-pixel units #38633
Conversation
Netlify deploy previewhttps://deploy-preview-38633--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
cbb04ca
to
d5a68ba
Compare
d21f47e
to
efd64ba
Compare
}; | ||
} | ||
|
||
if (props.theme?.breakpoints?.unit !== 'px') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Do we need to check if it's not px
? Why not just append the unit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brijeshb42 I just didn't want to change the existing behavior for pixels - i.e. returning maxWidth: 100
instead of maxWidth: '100px'
😬
Fixes #38594
Here's a sandbox showing the fix: https://codesandbox.io/s/https-github-com-mui-material-ui-pull-38633-6ry8rx?file=/src/App.tsx